package com.feinno.urcs.group.main;

import com.feinno.ENUM.Hop;
import com.feinno.urcs.dns.EnumService;
import com.feinno.urcs.dns.SipHop;
import com.feinno.urcs.sip.UrcsSipFactory;
import com.feinno.urcs.types.MobileNo;
import org.helium.framework.annotations.FieldSetter;
import org.helium.framework.annotations.ServiceImplementation;

import javax.sip.address.SipURI;
import javax.sip.address.URI;
import java.text.ParseException;
import java.util.Queue;

/**
 * Created by Lei Gao on 7/8/15.
 */
@ServiceImplementation
public class EnumServiceMock implements EnumService {

	@FieldSetter("${DOMAIN}")
	private String domain;

	@Override
	public SipURI getSipURI(URI uri) {
		return null;
	}

	@Override
	public SipURI getSipURI(MobileNo tel) {
		// 目前均可转换为SIPURI
		SipURI uri = null;
		try {
			uri = (SipURI) UrcsSipFactory.getAddressFactory().createURI(String.format("sip:%s@" + domain, tel.toString()));
		} catch (ParseException e) {

		}
		return uri;
	}

	@Override
	public SipHop locateHops(URI uri) {
		return null;
	}

	@Override
	public Queue<Hop> locateHops(String host) {
		return null;
	}

}
